 $LOAD_PATH.unshift File.join(File.dirname(__FILE__),'../..','ext_pr1/lib')
 require 'ext_pr1_v4'
 
 class List  
  def ==(o)
    self.equal?(o) or
    (o.list? and (first == o.first and rest == o.rest))
  end
  
 def reverse_endrec()
   self.size < 2 ? self : reverse_endrec_(List[],self) 
 end
 
 def reverse_endrec_(accu, data)
  data.empty? ? accu : reverse_endrec_(cons(data.first,accu),data.rest)
 end
 
 end